﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>深圳市城建管理工作平台</title>
<link href="index.css" rel="stylesheet" type="text/css" />
    <script src="../../../Script/jquery-1.7.1.min.js" type="text/javascript"></script>
    <link href="../../../JQuery_zTree_v3.5/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
    <script src="../../../JQuery_zTree_v3.5/js/jquery.ztree.core-3.5.min.js" type="text/javascript"></script>
</head>

<body>
    <div id="content">
        <div id="header">
            <iframe frameborder="0" id="Iframe1" name="top" src="top.html" width="100%" height="100%" scrolling="no"></iframe>
        </div>
        <div id="center">
            <div id="left">
               <div id="msgContent"></div>
               <div id="msgFoot"></div>
            </div>
            <div id="middle">
            </div>
            <div id="right">
               <iframe frameborder="0" id="DemoContext" name="DemoContext" src="tab/tab.aspx" scrolling="no"></iframe>
            </div>
        </div>
        
    </div>
<script type="text/javascript">

    function MenuBind() {
        $.ajax({
            url: "../../../ButtonConfigInfo/ButtonInfo.ashx?t=" + new Date().getDate().toString(),
            dataType: "text",
            type: "post",
            data: { stype: "getMenu", ShowUrl: "true", MenuTop: "true", ShowIcon: "true" },
            success: function (data) {
                var dataJson = window.eval("(" + data + ")");
                if (dataJson.state) {
                    $("#msgContent").html("");
                    var setting = {};
                    var zNodes = dataJson.rows;
                    for (var i = 0; i < zNodes.length; i++) {
                        var menuChild = $("<div>");
                        menuChild.addClass("imgclass").attr("id", zNodes[i].OID);
                        var title = $("<div>").addClass("MenuTitle").html(zNodes[i].name).bind("click", function () {
                            var TreeID = $(this).parent().attr("id");
                            $(".MenuContent").hide();
                            var nextHeight = $("#msgContent").height() - $(".MenuTitle").height() * $(".MenuTitle").length - 10;
                            $(this).next().height(nextHeight);
                            $(this).next().show("show");
                            MenuClick(TreeID, $(this).next());

                        });
                        var content = $("<ul>").addClass("MenuContent ztree");
                        menuChild.append(title);
                        menuChild.append(content);
                        $("#msgContent").append(menuChild);
                        $(".MenuContent").hide();
                    }
                    $("#msgContent").children(".imgclass").children(".MenuTitle").eq(0).click();
                }
            },
            error: function (i) {
                alert("出现异常，请刷新再试！");
            }
        });
    }

    //菜单树加载
    function MenuClick(TreeNode, ulTree) {
        $.ajax({
            url: "../../../ButtonConfigInfo/ButtonInfo.ashx?t=" + new Date().getDate().toString(),
            dataType: "text",
            type: "post",
            data: { stype: "getMenu2", ShowUrl: "true", TreeID: TreeNode, ShowIcon: "true" },
            success: function (data) {
                var dataJson = window.eval("(" + data + ")");
                if (dataJson.state) {
                    var setting = {};
                    var zNodes = dataJson.rows;
                    ulTree.html('');
                    for (var i = 0; i < zNodes[0].children.length; i++) {
                        var liItem = zNodes[0].children[i];
                        var li = $("<li><img src='images/" + liItem.icon + "' alt=''/><a href='" + liItem.url + "' target='" + liItem.target + "'>" + liItem.name + "</a></li>");
                        ulTree.append(li);
                    }
                }
            },
            error: function (i) {
                alert("出现异常，请刷新再试！");
            }
        });
    }
    $(function () {
        //菜单树加载
        MenuBind();
        $("#img1").bind("click", function () {
            if ($("#left").css("display") == "none") {
                $("#left").show();
            } else {
                $("#left").hide();
            }
        });
        $(window).resize(function () {
            $("#content").height((document.documentElement.clientHeight || document.body.clientHeight)).width((document.documentElement.clientWidth || document.body.clientWidth));
            $("#content").css("minWidth", 960);
            var cHeight = $("#content").height() - $("#header").height() - 10;
            $('#left,#right,#middle').height(cHeight);
            $('#msgContent').height(cHeight - $("#msgTitle").height() - $("#msgFoot").height());
            $('#DemoContext').height(cHeight - 10);
        });
        $(window).resize();
    });
</script>
</body>
</html>
